package sg.edu.ntu.metaweb.storage.data;

import java.io.Serializable;

public class User implements Serializable {

	private int userID;
	private String name;
	private String password;
	private String eMailAddress;
	
	
	public int getUserID() {
		return userID;
	}


	public String getName() {
		return name;
	}


	public String getPassword() {
		return password;
	}


	public String geteMailAddress() {
		return eMailAddress;
	}


	public User(String name, String password, String eMailAddress) {
		this.name = name;
		this.password = password;
		this.eMailAddress = eMailAddress;
		
		this.userID = eMailAddress.hashCode();
	}
	
	
	@Override
	public boolean equals(Object obj) {
		
		if (obj == null) 
			return false;
		
		if (obj.getClass() != this.getClass()) 
			return false;
		
		User u = (User)obj;
		if (this.userID == u.userID)
			return true;
		
		return false;		
	}
	
	@Override
	public int hashCode() {
		return userID;
	}
	
}
